
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <memory.h>

typedef struct
{ // 1byte = 8bit 按照字节来解析
    unsigned char bit0 : 1; // 低位
    unsigned char bit1 : 1;
    unsigned char bit2 : 1;
    unsigned char bit3 : 1;
    unsigned char bit4 : 1;
    unsigned char bit5 : 1;
    unsigned char bit6 : 1;
    unsigned char bit7 : 1; // 高位
} Byte;

int main()
{

    // unsigned char data = 174;
    float data = 3.1415926;
    int size_length = sizeof(data);
    double *p = nullptr;
    int a = sizeof(p);
    printf("%d\n",a);
    Byte *byte = (Byte *)&data;

    while (size_length--)  // 先打印高字节
    {
        printf("%d%d%d%d_%d%d%d%d ",  // 可用 %u 代替
               //高位
               (byte + size_length)->bit7,
               (byte + size_length)->bit6,
               (byte + size_length)->bit5,
               //低位
               (byte + size_length)->bit4,
               (byte + size_length)->bit3,
               (byte + size_length)->bit2,
               (byte + size_length)->bit1,
               (byte + size_length)->bit0);
    }
    printf("\n");
    // system("pause");

    return 0;
}